package huanzhao.erp.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import huanzhao.erp.domain.types.PackageState;
import huanzhao.erp.domain.types.PackageType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@TableName(value = "package")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Package implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 发货还是收货
     */
    @TableField(value = "ship")
    private Boolean ship;

    /**
     * 手机id
     */
    @TableField(value = "phone_id")
    private Long phoneId;

    /**
     * 签收人/发货人id
     */
    @TableField(value = "staff_id")
    private Long staffId;

    /**
     * 签收/发货操作时间
     */
    @TableField(value = "time")
    private Date time;


    @TableField(value = "type")
    private PackageType type;

    /**
     * 运单号
     */
    @TableField(value = "waybill")
    private String waybill;

    /**
     * 物流详细信息
     */
    @TableField(value = "detail")
    private String detail;

    /**
     * 包裹状态
     */
    @TableField(value = "state")
    private PackageState state;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Package(Boolean ship, Long phoneId, Long staffId, PackageType type, String waybill, String detail, PackageState packageState) {
        this.ship = ship;
        this.phoneId = phoneId;
        this.staffId = staffId;
        this.type = type;
        this.waybill = waybill;
        this.detail = detail;
        this.state = packageState;
    }
}